DEBUG =

FC = gfortran
FCFLAGS = -O2

%.o: %.f
	$(FC) $(FCFLAGS) -c $< -o $@

%.o: %.f90
	$(FC) $(FCFLAGS) -c $< -o $@



SRC_FILES = test.f90
SRC_FILES77 = test77.f

O_FILES		= $(SRC_FILES:%.f90=%.o)
O_FILES77	= $(SRC_FILES77:%.f=%.o)


LIBS = -lfxtc -lstdc++
## LIB_DIR = the absolute path of where you place the library
## Down below it is set to the local library directory
LIB_DIR = -L../readxtc/.libs

INCLUDE = interface.f90

EXEC = test.x
EXEC77 = test77.x






#
#   Individual dependencies to make main program edits trigger a build.
#




#
#   Here's the first (default) target to build.
#

all: $(EXEC) $(EXEC77) 
.PHONY: all

$(EXEC77): $(O_FILES77)
	${FC} ${DEBUG} -o $@ $^ ${LIB_DIR} ${LIBS}

$(EXEC): $(O_FILES)
	${FC} ${DEBUG} -o $@ $^ ${LIB_DIR} ${LIBS}

$(O_FILES): $(INCLUDE)

clean:
	- $(RM) $(O_FILES) $(O_FILES77) $(EXEC) $(EXEC77) core
